﻿@model Pager<SysClient>
@{
	ViewBag.Title = "会员信息列表";
}
<div class="ui-widget-header">
	<div style="padding: 5px 10px; font-size: 120%">
		@ViewBag.Title
	</div>
</div>
@using (Ajax.BeginForm(null,new AjaxOptions { UpdateTargetId = "Main" }))
{
	<div class="ui-cell">
		<label>会员编号</label>
		@Html.TextBox("SysNo",Request["SysNo"])
	</div>
	<div class="ui-cell">
		<label>工种</label>
		@Html.TextBox("LastWork",Request["LastWork"])
	</div>
	<div class="ui-cell">
		<label>姓名</label>
		@Html.TextBox("Name",Request["Name"])
	</div>
	<div class="ui-cell">
		<label>性别</label>
		@Html.DropDownList("Gender")
	</div>
	<div class="ui-cell">
		<label>出生年月</label>
		@Html.TextBox("Birthday", Request["Birthday"])
	</div>
	<div class="ui-cell">
		<label>民族</label>
		@Html.DropDownList("Ethnic")
	</div>
	<div class="ui-cell">
		<label>省</label>
		@Html.DropDownList("ProvinceSysNo")
	</div>
	<div class="ui-cell">
		<label>市</label>
		@Html.DropDownList("CitySysNo")
	</div>
	<div class="ui-cell">
		<label>联系电话</label>
		@Html.TextBox("Telphone",Request["Telphone"])
	</div>
	<div class="ui-cell-bar">
		<input class="btn" type="submit" value="查找" />
		@Ajax.ActionLink("添加", "Edit", null, new AjaxOptions { UpdateTargetId = "Main" }, new { @class = "btn" })
	</div>
}
<div class="ui-data">
	<table>
		<thead>
			<tr>
				<td colspan="11">@Html.Partial("Pager", Model)</td>
			</tr>
			<tr>
				<th>编号</th>
				<th>工种</th>
				<th>姓名</th>
				<th>性别</th>
				<th>生日</th>
				<th>民族</th>
				<th>电话</th>
				<th>学历</th>
				<th>薪资要求</th>
				<th>登记日期</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			@foreach (var row in Model)
   {
			<tr>
				<td>@Html.DisplayFor(p=>row.SysNo)</td>
				<td>@Html.DisplayFor(p=>row.LastWork)</td>
				<td>@Html.DisplayFor(p=>row.Name)</td>
				<td>@Html.DisplayFor(p=>row.Gender)</td>
				<td>@string.Format("{0:yyyy-MM-dd}",row.Birthday)</td>
				<td>@Html.DisplayFor(p=>row.Ethnic)</td>
				<td>@Html.DisplayFor(p=>row.Telphone)</td>
				<td>@Html.DisplayFor(p=>row.Education)</td>
				<td>@Html.DisplayFor(p=>row.Salery)</td>
				<td>@string.Format("{0:yyyy-MM-dd}",row.CreateDate)</td>
				<td>
					@Ajax.ActionLink("[修改]", "Edit", new { ID = row.ID }, new AjaxOptions { UpdateTargetId = "Main" })
					@(!row.Blocked?Html.ActionLink("[黑名单]", "Block", new { ID = row.ID }, new { @class = "blo" }):
					Html.ActionLink("[恢复]", "Edit", new { ID = row.ID }, new { @class = "res" }))
					@Html.ActionLink("[打印]", "Print", new { ID = row.ID, auto = true }, new { @class = "print" })
				</td>
			</tr>
   }
			<tr>
				<td colspan="11">@Html.Partial("Pager", Model)</td>
			</tr>
		</tbody>
	</table>
</div>
<script type="text/javascript">
	setTimeout(function () {
		calendar("Birthday");
		$("a.blo").click(function () {
			$.get($(this).attr("href"), {}, function (data) {
				_d = $("<div id='subMain'></div>").html(data).dialog({
					title: "加入黑名单原因",
					modal: true,
					autoOpen: true,
					width: 550,
					position: ['0', 'center'],
					close: function () { _d.remove(); window.datachanged && $(".btn:submit").submit(); }
				});
			})
			return false;
		});
		$("a.res").click(function () {
			$.post($(this).attr("href"), { Blocked: false }, function (res) {
				$(".btn:submit").submit();
			});
			return false;
		});
		$("#ProvinceSysNo").change(function () {
			$("#CitySysNo").load("@Url.Action("PCity")?provinceSysNo=" + ($(this).val() || "0"))
		})
	},0);
</script>
